//
//  NSString+TL.h
//  Coding_iOS
//
//  Created by taolei-mac on 2017/11/22.
//  Copyright © 2017年 com.lianchuan. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (TL)

- (NSString *)sha1Str;

- (NSDate *)dateWithStr;

/**
 * 将时间戳转化成日期
 */
- (NSDate *)dateWithTimeSp:(NSString *)timeSp;

- (NSString *)trimWhitespace;

- (NSRange)rangeByTrimmingRightCharactersInSet:(NSCharacterSet *)characterSet;

/**
 *  根据字体大小和限定的size计算UILabel控件的大小
 */
- (CGSize)getSizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size;

/**
 *  根据字体大小和限定的size计算UILabel控件的宽度
 */
- (CGFloat)getWidthWithFont:(UIFont *)font constrainedToSize:(CGSize)size;

/**
 *  根据字体大小和限定的size计算UILabel控件的高度
 */
- (CGFloat)getHeightWithFont:(UIFont *)font constrainedToSize:(CGSize)size;

- (NSMutableAttributedString *)arrributedStringWithMultipleChineseColor:(UIColor *)color1 andOtherColor:(UIColor *)color2;

@end
